/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.zjdt.epserver.db.service4mysql;

import com.zjdt.epserver.db.dao.MyCompanyDao;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;

/**
 *
 * @author dusin
 */
public class MyCompanyServiceImpl {
    static Logger logger = Logger.getLogger(MyCompanyServiceImpl.class);
    MyCompanyDao mycompanyDao;

    public MyCompanyServiceImpl(MyCompanyDao mycompanyDao) {
        this.mycompanyDao = mycompanyDao;
    } 
     
    public List<Map<String,Object>> findAll(){
        return mycompanyDao.findAll();
    } 
    
     public boolean create(String code,String name){
        return mycompanyDao.doCreate(new Object[]{code,name}); //
    }
    
    public boolean update(int id,String code,String name){
        return mycompanyDao.doUpdateById(new Object[]{code,name,id});
    }    
    public boolean remove(int id){
        return mycompanyDao.doDeleteById(id);
    }

    public List<Map<String, Object>> findAll4Combo() {
        return mycompanyDao.findAll4Combo();
    }
}
